package com.wang.just_sql;

import com.wang.utils.DatabaseUtils;

import javax.sql.DataSource;
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JustSqlDemo {
    public static void main(String[] args) throws IOException, SQLException {
        DataSource dataSource = DatabaseUtils.INSTANCE.dataSource();
        JustSql.InitDatabase(dataSource, new File("./src/main/resource/just_sql/sql.xml.vm"));
        List<String> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        Map<String, Object> p = new HashMap<>();
        p.put("list", list);
        System.out.println(JustSql.execute("/user/findById", p));
    }
}
